/* 
 * jobs/view.js
 */





var myLayout;

/**
 * Used for the jQuery.Layout.UI plugin, to properly size the height of the center pane to just big
 * enough for the actual content (rather than stretching it way bigger than its content).
 */
function sizeCenterPane () {
  var $Container	= $('div.ui-layout-container')
  var $Pane		= $('.ui-layout-center');
  //var $Content	= $('#content');
  var $Content	= $('div#centerContent');
  
  var outerHeight = $Pane.outerHeight();
  
  //console.log("");
  
  // use a Layout utility to calc total height of padding+borders (also handles IE6)
  var panePadding	= outerHeight - myLayout.cssHeight($Pane, outerHeight);
  // update the container height - *just* tall enough to accommodate #Content without scrolling
  $Container.height( $Pane.position().top + $Content.outerHeight() + panePadding );
  // resize panes to fit new container size
  myLayout.resizeAll();
}





$(document).ready(function(){


  // "New Version Like This" Fadein/Fadeout
  //$('tr').hover(
  $('tbody.rowWrapper').hover(
    function() {
      // apply fadein/fadeout animation to the child element with the approp class:
      $(this).find('.newVersionLikeThis').stop().animate({'opacity':1}, 300);
      $(this).find('.optionsRow td').stop().animate({'opacity':1}, 300);  
    },
    function() {
      $(this).find('.newVersionLikeThis').stop().animate({'opacity':0}, 300);
      $(this).find('.optionsRow td').stop().animate({'opacity':0}, 300);  
    }
  );
  // "New Version Like This" text enlarge/reduce 
  $('.newVersionLikeThis a').hover(
    function() {
          //$(this).stop().animate({'font-size':'110%'}, 200);
      $(this).stop().animate({'font-size':'108%'}, 200);
      // Animate wider width to the closest parent with class 'newVersionLikeThis'
      //$(this).closest('.newVersionLikeThis').stop().animate({'width':'120%'}, 500);
    },
    function() {
      $(this).stop().animate({'font-size':'100%'}, 200);
      
      //$(this).closest('.newVersionLikeThis').stop().animate({'width':'100%'}, 500);
    }
  );
    
  
        // Setup JQUERY.LAYOUT.UI plugin. This code properly sized the height to be just big enough for 
        // its content
        // From: http://layout.jquery-dev.net/demos/flexible_height_columns.html

        // first set a 'fixed height' on the container so it does not collapse...
      //  var $Container = $('div.ui-layout-container');
      //  $Container.height( $(window).height() - $Container.offset().top );
      //
      //  // NOW create the layout
      //  myLayout = $('div.ui-layout-container').layout({
      //    north__spacing_open: 0
      //  });
      //
      //  // now RESIZE the container to be a perfect fit
      //  sizeCenterPane();


    //  //$(document).ajaxStart($.blockUI).ajaxStop($.unblockUI); // For all Ajax calls, use the default 'blockUI' and 'unblockUI'
    //  // unblock the UI when any Ajax activity stops 
    //  $(document).ajaxStop($.unblockUI);
    
    
    

}); // end document ready func



